// default package
// Generated 23-mar-2015 17:46:53 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * CrsPerfilComercial generated by hbm2java
 */
@Entity
@Table(name = "crs_perfil_comercial", schema = "public")
public class CrsPerfilComercial implements java.io.Serializable {

	private int comercialid;
	private Users users;
	private CrsPerfilComercial crsPerfilComercial;
	private short comision;
	private Set crsPerfilComercials = new HashSet(0);
	private Set crsPerfilCentros = new HashSet(0);

	public CrsPerfilComercial() {
	}

	public CrsPerfilComercial(Users users, short comision) {
		this.users = users;
		this.comision = comision;
	}

	public CrsPerfilComercial(Users users,
			CrsPerfilComercial crsPerfilComercial, short comision,
			Set crsPerfilComercials, Set crsPerfilCentros) {
		this.users = users;
		this.crsPerfilComercial = crsPerfilComercial;
		this.comision = comision;
		this.crsPerfilComercials = crsPerfilComercials;
		this.crsPerfilCentros = crsPerfilCentros;
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "users"))
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "comercialid", unique = true, nullable = false)
	public int getComercialid() {
		return this.comercialid;
	}

	public void setComercialid(int comercialid) {
		this.comercialid = comercialid;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public Users getUsers() {
		return this.users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "comercialsupid")
	public CrsPerfilComercial getCrsPerfilComercial() {
		return this.crsPerfilComercial;
	}

	public void setCrsPerfilComercial(CrsPerfilComercial crsPerfilComercial) {
		this.crsPerfilComercial = crsPerfilComercial;
	}

	@Column(name = "comision", nullable = false)
	public short getComision() {
		return this.comision;
	}

	public void setComision(short comision) {
		this.comision = comision;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "crsPerfilComercial")
	public Set getCrsPerfilComercials() {
		return this.crsPerfilComercials;
	}

	public void setCrsPerfilComercials(Set crsPerfilComercials) {
		this.crsPerfilComercials = crsPerfilComercials;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "crsPerfilComercial")
	public Set getCrsPerfilCentros() {
		return this.crsPerfilCentros;
	}

	public void setCrsPerfilCentros(Set crsPerfilCentros) {
		this.crsPerfilCentros = crsPerfilCentros;
	}

}
